﻿using Catastrophe.BasePC.UI.Model;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Catastrophe.BasePC.UI.UIMode
{
    /// <summary>
    /// 主窗体左边数据模板
    /// </summary>
    public partial class MainWindowLeft : ObservableObject
    {
        /// <summary>
        /// 
        /// </summary>
        [ObservableProperty]
        private string showText;
        /// <summary>
        /// 是否选中
        /// </summary>
        [ObservableProperty]
        private bool isSelected;
        /// <summary>
        /// 数据
        /// </summary>
        [ObservableProperty]
        private SysMenuEntity entity;

        public ICommand Click { get; set; }

        public event Action<SysMenuEntity> Clicked;
        /// <summary>
        /// 子节点
        /// </summary>
        [ObservableProperty]
        private ObservableCollection<MainWindowLeft> nodes;

        public MainWindowLeft()
        {
            Click = new RelayCommand(ClickMethod);
        }

        private void ClickMethod()
        {
            Clicked?.Invoke(entity);
        }
    }
}
